<?php 
session_start();include "conn.php";
?>
<?php  include("admin.php");?>


<?php
//文件名。。。
 $webname="target"; 
 $linkname="target"; 
?>



<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?php
$id=make_safe($_GET["id"]);
$nid=make_safe($_GET["nid"]);
$images=make_safe($_GET["images"]);
$action=make_safe($_GET["action"]);
$item =make_safe($_POST["items"]);

include("check.php");

//删除图片
if($images!=""){
unlink($images);
}

//删除数据
if ($id!="" and $action=="del") {
	
	
			
		$sql="select * from ".$webname."  where id in (".$id.")  ";			
	$result=mysql_query($sql);
	while ($row=mysql_fetch_object($result)){
     
	if($row->images){unlink($row->images);}
	
	}	
	$sql="Delete from ".$webname."   where id in (".$id.")";
			$result=mysql_query($sql);		
	
	echo "<script>window.location.href='".$linkname.".php?page=".$page."';</script>";

}
?>


<?php 
	
	
	
 
$nid=make_safe($_GET["nid"]);
$BigClassName=make_safe($_GET["BigClassName"]);
$title=make_safe($_GET["title"]);


	 if($item=="" && $id==""){ echo "<script>window.location.href='".$linkname.".php?nid=".$nid."&BigClassName=".urlencode($BigClassName)."&title=".urlencode($title)."&page=".$page."';</script>";}
	
	
	
	if( $item<>""){
	
	//删除图片
	$sql="select * from ".$webname."  where id in (".$item.")  ";			
	$result=mysql_query($sql);
	while ($row=mysql_fetch_object($result)){
     
	if($row->images){unlink($row->images);}
	
	}
	
	//删除数据
		if ($_POST[submit]!=""){
			$sql="Delete from ".$webname."  where id in (".$item.")";
			$result=mysql_query($sql);
			
			echo "<script>window.location.href='".$linkname.".php?page=".$page."';</script>";
		}
	}
	else{
		
	}
	
	
	
?>